package daos

import (
	"github.com/redis/go-redis/v9"
	clientv3 "go.etcd.io/etcd/client/v3"
	"gorm.io/gorm"
)

type Database struct {
	Conn *gorm.DB
}

var instance *Database

func init() {
	instance = new(Database)
}

func GetConnection() *gorm.DB {
	return instance.Conn
}

func SetDB(db *gorm.DB) {
	instance.Conn = db
}

var rdb *redis.Client

func SetRDB(db *redis.Client) {
	rdb = db
}

func GetRedis() *redis.Client {
	return rdb
}

var etcd *clientv3.Client

func SetEtcd(db *clientv3.Client) {
	etcd = db
}

func GetEtcd() *clientv3.Client {
	return etcd
}
